<template>
	<el-col>
	    <el-menu :default-active="defaultActive" class="el-menu-vertical-demo" :default-openeds="defaultOpen">
	    	<el-submenu index="1">
	        	<template slot="title"><i class="default-order-icon default-wallet-icon"></i>我的钱包</template>
	        	<el-menu-item index="1-1">
	        		<template slot="title"><router-link tag="a" :to="{name: 'Wallet'}">钱包主页</router-link></template>
	        	</el-menu-item>
        		<el-menu-item index="1-2">
	        		<template slot="title"><router-link tag="a" :to="{name: 'Receipt'}">发票管理</router-link></template>
	        	</el-menu-item>
	      	</el-submenu>
	    </el-menu>
  	</el-col>
</template>
<script>
	export default {
		data(){
			return {
				defaultOpen: ['1'],
				defaultActive: "1-1"
			}
		},
		created(){
        	this.routeChange();
        },
        methods: {
        	routeChange(){
		    	var url = window.location.href;
				var strs = url.split("/");
				var str = strs[strs.length - 1];
				if(str == 'receipt'){
					this.defaultActive = "1-2";
				}else if(str == 'Wallet'){
					this.defaultActive = "1-1";
				}
		    }
        }
	}
</script>
<style>
</style>